/*
 * FaceCat图形通讯框架
 * 著作权编号:2015SR229355+2020SR0266727
 * 上海卷卷猫信息技术有限公司
 */

using System;
using System.Collections.Generic;

namespace FaceCat
{
    /// <summary>
    /// 日历
    /// </summary>
    [Serializable()]
    public class CYears
    {
        /// <summary>
        /// 年的集合
        /// </summary>
        private HashMap<int, CYear> m_years = new HashMap<int, CYear>();

        /// <summary>
        /// 获取年
        /// </summary>
        /// <param name="year">年份</param>
        /// <returns>年</returns>
        public virtual CYear getYear(int year)
        {
            if (!m_years.containsKey(year))
            {
                m_years.put(year, new CYear(year));
            }
            return m_years.get(year);
        }

        /// <summary>
        /// 清除数据
        /// </summary>
        public virtual void delete()
        {
            foreach (CYear year in m_years.Values)
            {
                year.delete();
            }
            m_years.clear();
            m_years = null;
        }
    }
}
